package com.maybach.workflow.core.manager.impl;

import com.maybach.util.query.support.PageResult;
import com.maybach.workflow.common.model.FlowApplyIndexDO;
import com.maybach.workflow.common.query.FlowApplyIndexQuery;
import com.maybach.workflow.core.dal.mapper.ext.FlowApplyIndexExtMapper;
import com.maybach.workflow.core.manager.FlowApplyIndexManager;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * Manager for FlowApplyIndex.
 */

@Component
public class FlowApplyIndexManagerImpl implements FlowApplyIndexManager{
    protected Logger log = LoggerFactory.getLogger(this.getClass());

    
    @Autowired
    protected FlowApplyIndexExtMapper flowApplyIndexExtMapper;
    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(FlowApplyIndexQuery query){
        return flowApplyIndexExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(FlowApplyIndexQuery query){
        return flowApplyIndexExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(Long id){
        return flowApplyIndexExtMapper.deleteByPrimaryKey(id);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(FlowApplyIndexDO record){
        return flowApplyIndexExtMapper.insertSelective(record);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<FlowApplyIndexDO> selectByQuery(FlowApplyIndexQuery query){
        return flowApplyIndexExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
    */
    @Override
    public PageResult<FlowApplyIndexDO> selectByQueryWithPage(FlowApplyIndexQuery query) {
        PageResult<FlowApplyIndexDO> result = new PageResult<FlowApplyIndexDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public FlowApplyIndexDO selectByPrimaryKey(Long id){
        return flowApplyIndexExtMapper.selectByPrimaryKey(id);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective( FlowApplyIndexDO record,  FlowApplyIndexQuery query){
        return flowApplyIndexExtMapper.updateByQuerySelective(record,  query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery( FlowApplyIndexDO record,  FlowApplyIndexQuery query){

        return flowApplyIndexExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(FlowApplyIndexDO record){
        return flowApplyIndexExtMapper.updateByPrimaryKeySelective(record);
    }
}